package com.campus.bbs;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import com.campus.utils.Http;

public class GetMob implements GetITieInfo {
int p;
int p2;
String kw="西安财经学院";


	@Override
	public ArrayList<TieInfo> getTieInfoList() throws MalformedURLException,
			IOException {
		// TODO Auto-generated method stub
		p2=p*30;
		ArrayList <TieInfo>list=new ArrayList();
		String url="http://tieba.baidu.com/mo/q---180EEE5213CE8AE5CA43FD038A45F50D%3AFG%3D1--1-3-0--2--wapp_1463813770054_914/m?kw="+"ufe"+"&lp=1030&pn="+p2;
		String get=Http.get(url, "UTF-8");
		Document doc=Jsoup.parse(get);
		Elements ele=doc.select("div.i");
	
		for(Element e:ele)
		{	TieInfo info=new TieInfo();
			System.out.println(e.select("a").text());
			System.out.println(e.select("p").text());
			info.title=e.select("a").text();
					info.sencond=e.select("p").text();
					info.url="http://tieba.baidu.com/mo/"+e.select("a").attr("href");
			list.add(info);
		}
		p++;
		return list;
	}
}
